package org.jeecg.modules.accessControl.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.accessControl.entity.*;
import org.jeecg.modules.accessControl.service.LwgyAccessControlReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * TODO
 *
 *
 */
@Api(tags="查寝统计")
@RestController
@RequestMapping("/accessControl/lwgyAccessControlReport")
@Slf4j
public class LwgyAccessControlReportController extends JeecgController<LwgyAccessControlReport, LwgyAccessControlReportService> {

    @Autowired
    private LwgyAccessControlReportService lwgyAccessControlReportService;


    /**
     * 校区统计
     * @author
     * */
    @PostMapping("/campusReport")
    public Result<?>campusReport(@RequestBody LwgyAccessControlReportCampus lwgyAccessControlReportCampus){
        List<LwgyAccessControlReportCampus> reportList = lwgyAccessControlReportService.campusReport(lwgyAccessControlReportCampus);
//        List<Map<String,Integer>> campusList = new ArrayList<>(5);
        return Result.OK(reportList);
    }

    @PostMapping("/campusReportList")
    public Result<?>campusReportList(@RequestBody LwgyAccessControlReportCampus lwgyAccessControlReportCampus){
        List<LwgyAccessControlReportCampus> reportList = lwgyAccessControlReportService.campusReport(lwgyAccessControlReportCampus);
        IPage<LwgyAccessControlReportCampus>reportIPage = new Page<>(0,100);
        reportIPage.setRecords(reportList);
        return Result.OK(reportIPage);
    }


    /**
     * 楼宇统计
     * @author
     * */
    @PostMapping("/buildingReport")
    public Result<?>buildingReport(@RequestBody LwgyAccessControlReportBuilding lwgyAccessControlReportBuilding){
        List<LwgyAccessControlReportBuilding> reportList = lwgyAccessControlReportService.buildingReport(lwgyAccessControlReportBuilding);
//        List<Map<String,Integer>> campusList = new ArrayList<>(5);
        return Result.OK(reportList);
    }

    @PostMapping("/buildingReportList")
    public Result<?>buildingReportList(@RequestBody LwgyAccessControlReportBuilding lwgyAccessControlReportBuilding){
        List<LwgyAccessControlReportBuilding> reportList = lwgyAccessControlReportService.buildingReport(lwgyAccessControlReportBuilding);
        IPage<LwgyAccessControlReportBuilding>reportIPage = new Page<>(0,100);
        reportIPage.setRecords(reportList);
        return Result.OK(reportIPage);
    }

    /**
     * 院系统计
     * @author
     * */
    @PostMapping("/collegeReport")
    public Result<?>collegeReport(@RequestBody LwgyAccessControlReportCollege lwgyAccessControlReportCollege){
        List<LwgyAccessControlReportCollege> reportList = lwgyAccessControlReportService.collegeReport(lwgyAccessControlReportCollege);
//        List<Map<String,Integer>> campusList = new ArrayList<>(5);
        return Result.OK(reportList);
    }

    @PostMapping("/collegeReportList")
    public Result<?>collegeReportList(@RequestBody LwgyAccessControlReportCollege lwgyAccessControlReportCollege){
        List<LwgyAccessControlReportCollege> reportList = lwgyAccessControlReportService.collegeReport(lwgyAccessControlReportCollege);
        IPage<LwgyAccessControlReportCollege>reportIPage = new Page<>(0,100);
        reportIPage.setRecords(reportList);
        return Result.OK(reportIPage);
    }


    /**
     * 院系统计
     * @author
     * */
    @PostMapping("/classReport")
    public Result<?>classReport(@RequestBody LwgyAccessControlReportClass lwgyAccessControlReportClass){
        List<LwgyAccessControlReportClass> reportList = lwgyAccessControlReportService.classReport(lwgyAccessControlReportClass);
//        List<Map<String,Integer>> campusList = new ArrayList<>(5);
        return Result.OK(reportList);
    }

    @PostMapping("/classReportList")
    public Result<?>classReportList(@RequestBody LwgyAccessControlReportClass lwgyAccessControlReportClass){
        List<LwgyAccessControlReportClass> reportList = lwgyAccessControlReportService.classReport(lwgyAccessControlReportClass);
        IPage<LwgyAccessControlReportClass>reportIPage = new Page<>(0,100);
        reportIPage.setRecords(reportList);
        return Result.OK(reportIPage);
    }

    /**
     * 学生统计
     * @author
     * */
    @PostMapping("/studentReport")
    public Result<?>studentReport(@RequestBody LwgyAccessControlReportStudent lwgyAccessControlReportStudent){
        List<LwgyAccessControlReportStudent> reportList = lwgyAccessControlReportService.studentReport(lwgyAccessControlReportStudent);
//        List<Map<String,Integer>> campusList = new ArrayList<>(5);
        return Result.OK(reportList);
    }

    @PostMapping("/studentReportList")
    public Result<?>studentReportList(@RequestBody LwgyAccessControlReportStudent lwgyAccessControlReportStudent){
        List<LwgyAccessControlReportStudent> reportList = lwgyAccessControlReportService.studentReport(lwgyAccessControlReportStudent);
        IPage<LwgyAccessControlReportStudent>reportIPage = new Page<>(0,100);
        reportIPage.setRecords(reportList);
        return Result.OK(reportIPage);
    }



}
